package org.example.project

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowDown
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
//
//@Composable
//fun MyMapScreen() {
////    Box(modifier = Modifier.fillMaxSize()) {
////        Text("地图界面")
////        // ...其他内容
////    }
//
//    TencentMapDrawer(
//        onCollapse = { /* 可以做点收起时候的事情 */ },
//        onSemiExpand = { /* 半展开的时候做事情 */ },
//        onExpand = { /* 全展开的时候做事情 */ }
//    ) { drawerState, progress ->
//        Box(modifier = Modifier.fillMaxSize()) {
//
//            if (drawerState == DrawerState.Expanded) {// 展开
//                Collapsed()
//                SemiExpanded()
//                ExpandedView(progress)
//            }else if (drawerState == DrawerState.SemiExpanded) {
//                Collapsed()
//                SemiExpanded()
//            }else if (drawerState == DrawerState.Collapsed) {
//                Collapsed()
//
//
//            }
//        }
//    }
//}
//
//@Composable
//private fun Collapsed() {
//    Box(
//        modifier = Modifier
//            .width(36.dp)
//            .height(4.dp)
//            .background(Color(0xFFBDBDBD), RoundedCornerShape(2.dp))
//    )
//
//    Spacer(modifier = Modifier.height(14.dp))
//
//    Row(
//        modifier = Modifier.fillMaxWidth(),
//        verticalAlignment = Alignment.CenterVertically,
//        horizontalArrangement = Arrangement.SpaceBetween
//    ) {
//        Row(verticalAlignment = Alignment.CenterVertically) {
//            Text(
//                text = "9.6公里  30分钟",
//                fontSize = 18.sp,
//                fontWeight = FontWeight.Bold
//            )
//        }
//
//        Row(verticalAlignment = Alignment.CenterVertically) {
//            IconButton(onClick = { /* 小功能按钮 */ }) {
//                Icon(
//                    imageVector = Icons.Default.KeyboardArrowDown,
//                    contentDescription = "收起",
//                    tint = Color.Gray
//                )
//            }
//        }
//    }
//
//    Text(
//        text = "预计 19:07 到达",
//        fontSize = 14.sp,
//        color = Color.Gray,
//        modifier = Modifier
//            .padding(top = 4.dp)
//    )
//}
//
//// 自定义的半展开视图
//@Composable
//private fun SemiExpanded() {
//    Spacer(modifier = Modifier.height(8.dp))
//
//    Row(
//        modifier = Modifier
//            .fillMaxWidth()
//            .padding(horizontal = 12.dp),
//        horizontalArrangement = Arrangement.SpaceEvenly
//    ) {
//        listOf("路线偏好", "沿途搜", "反馈", "行程分享").forEach { text ->
//            Column(horizontalAlignment = Alignment.CenterHorizontally) {
//                Surface(
//                    modifier = Modifier.size(36.dp),
//                    color = Color(0xFFF0F0F0),
//                    shape = RoundedCornerShape(10.dp),
//                    elevation = 1.dp
//                ) {
//                    Box(contentAlignment = Alignment.Center) {
//                        Text(text.first().toString(), fontSize = 16.sp)
//                    }
//                }
//                Spacer(modifier = Modifier.height(2.dp))
//                Text(
//                    text = text,
//                    fontSize = 11.sp,
//                    color = Color.DarkGray
//                )
//            }
//        }
//    }
//}
//
//// 自定义的展开视图
//@Composable
//private fun ExpandedView(progress: Float) {
//    Spacer(
//        modifier = Modifier.height(
//            (8 + (12 * (1 - progress))).dp
//        )
//    )
//
//    Column(
//        modifier = Modifier
//            .fillMaxWidth()
//            .padding(top = 8.dp)
//    ) {
//        Text(
//            text = "车辆信息",
//            fontSize = 18.sp,
//            fontWeight = FontWeight.Bold,
//            modifier = Modifier.padding(bottom = 8.dp)
//        )
//
//        repeat(10) { index ->
//            Text(
//                text = "信息项 ${index + 1}",
//                fontSize = 16.sp,
//                modifier = Modifier
//                    .fillMaxWidth()
//                    .padding(vertical = 6.dp)
//            )
//        }
//    }
//}